package util.toolkit;

import java.io.UnsupportedEncodingException;

//import sun.awt.image.PNGImageDecoder.Chromaticities;

/**
 * 字符串的转换工具类
 * @author zhangjs
 * @since 2017-3-21
 */
public class StrUtil {

	/**
	 * 实现将乱码字符使用指定字符集进行重新编码
	 * @param str 带有乱码的字符串
	 * @return String 编码后的字符串
	 */
	public static String chr(String str){
		String s = str;
		try {
			s = new String(str.getBytes("ISO-8859-1"),"UTF-8");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return s; 
	}
}
